MODEL_CONVERTER = MONO_PATH=../src/SharpEntropy/:../src/OpenNLP $(MONO) ../src/ModelConverter/ModelConverter.exe

MODELS_FILES = \
	$(srcdir)/models/chunker/EnglishChunk.nbin \
	$(srcdir)/models/postag/EnglishPOS.nbin \
	$(srcdir)/models/sentdetect/EnglishSD.nbin \
	$(srcdir)/models/tokenize/EnglishTok.nbin

PARSER_FILES = \
	$(srcdir)/models/parser/build.nbin \
	$(srcdir)/models/parser/check.nbin \
	$(srcdir)/models/parser/chunk.nbin \
	$(srcdir)/models/parser/head_rules \
	$(srcdir)/models/parser/tag.nbin \
	$(srcdir)/models/parser/tagdict

NAMEFIND_FILES = \
	$(srcdir)/models/namefind/date.nbin \
	$(srcdir)/models/namefind/location.nbin \
	$(srcdir)/models/namefind/money.nbin \
	$(srcdir)/models/namefind/organization.nbin \
	$(srcdir)/models/namefind/percentage.nbin \
	$(srcdir)/models/namefind/person.nbin \
	$(srcdir)/models/namefind/time.nbin

MODELS = \
	$(MODELS_FILES) \
	$(PARSER_FILES) \
	$(NAMEFIND_FILES)

all: $(MODELS)

$(MODELS): generated-stamp 

generated-stamp: decompressed-stamp
	$(MODEL_CONVERTER) $(srcdir)/models && touch generated-stamp

decompressed-stamp:
	$(GUNZIP) -r $(srcdir)/models && touch decompressed-stamp

modelsdir = $(pkglibdir)/models
models_DATA = $(MODELS_FILES)

parserdir = $(modelsdir)/parser
parser_DATA = $(PARSER_FILES)

namefinddir = $(modelsdir)/namefind
namefind_DATA = $(NAMEFIND_FILES)

MAINTAINERCLEANFILES = Makefile.in
